<?php

/*
 * EachGo电商网站 新媒体
 * www.eachgo.cn
 */

namespace Home\Model;

/**
 * AdInfoModel
 * 请输入描述
 * @author Moon
 */
use Think\Model;

class AdInfoModel extends Model {
    /*
     * 增加一条记录
     */

    public function addAdInfo($obj) {
        $res = $this->add($obj);
        return $res;
    }

    /*
     * 删除一条记录
     */

    public function deleteAdInfo($obj) {
        $res = $this->where('ID = "' . $obj['ID'] . '"')->delete();
        return $res;
    }

    /*
     * 更新一条记录
     */

    public function updateAdInfo($obj) {
        $res = $this->where('ID = "' . $obj['ID'] . '"')->save($obj);
        return $res;
    }

    /*
     * 查询记录 by 时间
     */

    public function selectAdInfoByTime($obj) {
        $res = $this->where('Take_Down_Time = "' . $obj['Take_Down_Time'] . '"')->select();
        return $res;
    }

    /*
     * 查询记录 by 内容
     */

    public function selectAdInfoByText($obj) {
        $res = $this->where('school_ID = "' . $obj['school_ID'] . '"')->select();
        return $res;
    }

    /*
     * 查询记录 by 时间
     */

    public function selectAdInfoByShareId($obj) {
        $res = $this->where('is_Check_Out = "' . $obj['is_Check_Out'] . '"')->select();
        return $res;
    }

}
